<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
	</head>
	<body>
		<img src="img/1.jpg" id="img1">
		<br>
		<button type="button" onclick="starts()">开始</button>
	</body>
	<script type="text/javascript">
	var i=0;
		function starts(){
			
			var num=0;
			
				var allimg = document.getElementById('img1');
				var aa = setInterval(function(){
				var arrone = chosearr();
				allimg.src="img/"+arrone+".jpg"
				num=num+1;
				if(num==30){
					clearInterval(aa);
				}
			},500) 
			
			
		}
		function chosearr(){
			i++;
			if(i>9){
				i=1;
			}	
			return i;
			}
		
	</script>
</html>
